const int pressurePin = A0; //pin AO is connected to output voltage
float volume = 0; // initial volume is set as zero.

void setup(){ //setup
  Serial.begin(9600); //Begin serial communication with baud rate 9600.
  pinMode(pressurePin, INPUT); //Set the pressure pin as an input.
}

void loop(){ //loop
  float inputValue = analogRead(pressurePin); //read the input value from the pressure pin (analog from 0 to 1023).
  float voltage = (inputValue/1024.0)*5.0; //convert the input value to voltage ranged from 0 to 5 volt.
  float pressure = (voltage/5.0)*10000.0; //convert the voltage to the differential pressure ranged from 0 to 10 kPa (sensor MPXV5010DP)
  if (pressure <=425 || pressure >=445){ // the differential pressure is not in the interval of the offset.
    volume = volume + 0.01; // !!!!What is the value needed to be added?!!!!
  }
  else // the differential pressure is in the interval of the offset.
    volume = 0; //the volume is back to 0 
  Serial.print("Pressure:");
  Serial.println(pressure); // Print out the differential pressure value
  Serial.print("Volume:");
  Serial.println(volume); // Print out the cumulative volume
  delay(100); //delay in every 10 milliseconds
}
